/**
 * 
 */
package me.myachievements.web.administration.account;

import java.util.List;

import org.apache.wicket.injection.web.InjectorHolder;
import org.apache.wicket.model.LoadableDetachableModel;
import org.apache.wicket.spring.injection.annot.SpringBean;

import me.myachievements.persistence.account.Account;
import me.myachievements.persistence.account.AccountPersistenceManager;

/**
 * @author besseym
 *
 */
public class AccountListModel extends LoadableDetachableModel<List<Account>> {
	
	@SpringBean(name="accountPersistenceManager")
	AccountPersistenceManager accountPersistenceManager;
	
	public AccountListModel(){
		InjectorHolder.getInjector().inject(this);
	}
	
	@Override
	protected List<Account> load() {
		return accountPersistenceManager.findAll();
	}

}
